#  -*- coding: utf-8 -*-

import psycopg2
import schedule
import time
import datetime
import threading


# def pg_conn():
#     conn = psycopg2.connect(database="postgres", user="postgres", password="pgsql!@#", host="47.114.180.73",
#                             port="5432")
#     cur = conn.cursor()
#     cur.execute('''CREATE TABLE COMPTEST
#                (ID INT PRIMARY KEY     NOT NULL,
#                NAME           TEXT    NOT NULL,
#                AGE            INT     NOT NULL,
#                ADDRESS        CHAR(50),
#                SALARY         REAL);''')
#     conn.commit()
#     conn.close()
# pg_conn()

class Pg_to_mysql(object):

    def __init__(self):
        pass
    def pg_conn(self):
        conn = psycopg2.connect(database="postgres", user="postgres", password="pgsql!@#", host="47.114.180.73", port="5432")
        cur = conn.cursor()
        sql='''select* from test_pg_mysql'''
        cur.execute(sql)
        rows = cur.fetchall()

        conn.close()
        return rows

#
# if __name__ == '__main__':
#     conn=Pg_to_mysql()
#     # conn.pg_conn()
